package mips.instruction;

import mips.Reg;
import mips.element.Instruction;

public class SLE extends Instruction {
    private Reg rs;
    private Reg rt;
    private Reg rd;
    private int imm;

    public SLE(Reg rd, Reg rs, Reg rt) {
        this.rd = rd;
        this.rs = rs;
        this.rt = rt;
    }

    public SLE(Reg rd, Reg rs, int imm) {
        this.rd = rd;
        this.rs = rs;
        this.imm = imm;
    }

    public Reg getRs() {
        return rs;
    }

    public Reg getRt() {
        return rt;
    }

    public Reg getRd() {
        return rd;
    }

    public String toString() {
        if (rt != null) {
            return "sle\t" + rd + " " + rs + " " + rt;
        } else {
            return "sle\t" + rd + " " + rs + " " + imm;
        }
    }
}
